package Dialogs
{
	import flash.display.DisplayObject;
	import flash.display.Sprite;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	import flash.text.TextFormatAlign;

	public class CharacterDialog
	{
		public var baseDialog:D1;
		public var display:Sprite = new Sprite();
		public function CharacterDialog(title:String, img:String, dialog:String)
		{
			baseDialog = new D1(title, 600, 475);
			display.addChild(baseDialog.display);
			var boss1:DisplayObject = ImageManager.getImage(img);
			display.addChild(boss1);
			boss1.x = display.width - boss1.width - Game.PADDING;
			boss1.y = baseDialog.title_tf.height + baseDialog.display.height/2 - boss1.height/2;
			
			var trashTalk:TextField = new TextField();
			var talkContainer:Sprite = new Sprite();//Util.getRoundRectSprite(400,200,0,.7);
			talkContainer.addChild(trashTalk);			
			Util.applyStyleH2(trashTalk);
			trashTalk.text = dialog;
			trashTalk.width  = 350;

			trashTalk.wordWrap = true;
			trashTalk.defaultTextFormat.align = TextFormatAlign.CENTER;
			
			display.addChild(talkContainer);
			talkContainer.x = Game.PADDING;
			talkContainer.y = baseDialog.title_tf.height + Game.PADDING*2;
			
		}
		
		
		public function set onCloseCallback(closeCallback:Function):void{
			baseDialog.closeClickCallback = closeCallback;
		}
	}
}